/**
 * Copyright (c) 2020 铭软科技(mingsoft.net)
 * 本软件及相关文档文件（以下简称“软件”）的版权归 铭软科技 所有
 * 遵循铭软科技《保密协议》
 */
package net.mingsoft.mwebsite.entity;

import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import net.mingsoft.base.entity.BaseEntity;
import net.mingsoft.basic.util.StringUtil;

/**
 * 网站基本信息实体类
 * @author 铭软团队
 * @version
 * 版本号：100-000-000<br/>
 * 创建日期：2012-03-15<br/>
 * 历史修订：<br/>
 */
@TableName("app")
public class WebsiteEntity extends BaseEntity {

	//重写id
	@TableField(exist = false)
	private String id;

	/**
	 * 应用名称
	 */
	@TableField(value = "APP_NAME")
	private String websiteName;

	/**
	 * 应用描述
	 */
	@TableField(value = "APP_DESCRIPTION")
	private String websiteDescription;

	/**
	 * 应用logo
	 */
	@TableField(value = "APP_LOGO")
	private String websiteLogo;

	/**
	 * 应用编号
	 */
	@TableId(value = "id")
	private int websiteId;

	/**
	 * 网站采用的模板风格
	 */

	@TableField(value = "APP_STYLE")
	private String websiteStyle;


	/**
	 * 网站关键字
	 */
	@TableField(value = "APP_KEYWORD")
	private String websiteKeyword;

	/**
	 * 网站版权信息
	 */
	@TableField(value = "APP_COPYRIGHT")
	private String websiteCopyright;

	/**
	 * 网站域名
	 */
	@TableField(value = "APP_URL")
	private String websiteUrl;

	/**
	 * 网站生成目录
	 */
	@TableField(value = "APP_DIR")
	private String websiteDir;

	/**
	 * 站点日期
	 */
	@JSONField(format = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@TableField(value = "APP_DATETIME")
	private Date websiteDatetime;

	/**
	 * 应用续费时间
	 */
	@JSONField(format = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@TableField(value = "APP_PAY_DATE")
	private Date websitePayDate;


	/**
	 * 应用费用清单
	 */
	@TableField(value = "APP_PAY")
	private String websitePay;

	/**
	 * 网站状态 0:运行中 1:停止
	 */
	@TableField(value = "APP_STATE")
	private int websiteState;


	public String getWebsiteDir() {
		return websiteDir;
	}

	public void setWebsiteDir(String websiteDir) {
		this.websiteDir = websiteDir;
	}

	public int getWebsiteState() {
		return websiteState;
	}

	public void setWebsiteState(int websiteState) {
		this.websiteState = websiteState;
	}

	public Date getWebsitePayDate() {
		return websitePayDate;
	}

	public void setWebsitePayDate(Date websitePayDate) {
		this.websitePayDate = websitePayDate;
	}

	public String getWebsitePay() {
		return websitePay;
	}

	public void setWebsitePay(String websitePay) {
		this.websitePay = websitePay;
	}

	public Date getWebsiteDatetime() {
		return websiteDatetime;
	}

	public void setWebsiteDatetime(Date websiteDatetime) {
		this.websiteDatetime = websiteDatetime;
	}

	/**
	 * 获取网站版权信息
	 *
	 * @return 返回网站版权信息
	 */
	public String getWebsiteCopyright() {
		return websiteCopyright;
	}

	public String getWebsiteDescription() {
		return websiteDescription;
	}

	public int getWebsiteId() {
		return websiteId;
	}

	/**
	 * 获取网站的关键字
	 *
	 * @return 返回网站关键字
	 */
	public String getWebsiteKeyword() {
		return websiteKeyword;
	}

	public String getWebsiteName() {
		return websiteName;
	}

	/**
	 * 获取网站使用的模板风格
	 *
	 * @return 返回网站使用的模板风格
	 */
	public String getWebsiteStyle() {
		return websiteStyle;
	}

	/**
	 * 获取网站域名
	 */
	public String getWebsiteUrl() {
		return websiteUrl;
	}

	/**
	 * 获取网站域名
	 */
	public String getWebsiteHostUrl() {
		if (!StringUtil.isBlank(websiteUrl) && websiteUrl.indexOf("\n") > 0) { //存在多个域名绑定
			return websiteUrl.split("\n")[0].trim();
		}
		return websiteUrl;
	}

	public String getWebsiteLogo() {
		return websiteLogo;
	}

	/**
	 * 设置网站版权信息
	 *
	 * @param websiteCopyright
	 */
	public void setWebsiteCopyright(String websiteCopyright) {
		this.websiteCopyright = websiteCopyright;
	}

	public void setWebsiteDescription(String websiteDescription) {
		this.websiteDescription = websiteDescription;
	}

	public void setWebsiteId(int websiteId) {
		this.websiteId = websiteId;
	}

	/**
	 * 设置网站关键字
	 *
	 * @param websiteKeyword
	 */
	public void setWebsiteKeyword(String websiteKeyword) {
		this.websiteKeyword = websiteKeyword;
	}

	public void setWebsiteName(String websiteName) {
		this.websiteName = websiteName;
	}

	/**
	 * 设置网站使用的模板风格
	 *
	 * @param websiteStyle
	 */
	public void setWebsiteStyle(String websiteStyle) {
		this.websiteStyle = websiteStyle;
	}

	/**
	 * 设置网站域名
	 *
	 * @param websiteUrl
	 */
	public void setWebsiteUrl(String websiteUrl) {
		this.websiteUrl = websiteUrl;
	}


	public void setWebsiteLogo(String websiteLogo) {
		this.websiteLogo = websiteLogo;
	}

}
